﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AdminSearchUser.aspx.cs" Inherits="Aandelendelen.Admin.AdminSearchUser" %>

<%@ Register Src="/Controls/TopControl.ascx" TagName="TopControl" TagPrefix="uc1" %>
<%@ Register Src="/Controls/MenuControl.ascx" TagName="MenuControl" TagPrefix="uc5" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>AandelenDelen</title>
    <link href="/Css/Common.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div class="common">
   		<uc1:TopControl ID="TopControl1" runat="server" />
		<uc5:MenuControl id="MenuControl1" runat="server"></uc5:MenuControl>
    <hr />
    <asp:Panel ID="entryPanel" runat="server" Visible="true">
		<p class="title">Zoek een user m.b.v. Like</p>
		<table>
			<tr>
				<td>Gebruikersnaam</td>
				<td>Achternaam</td>
				<td>Woonplaats</td>
				<td>Email</td>
			</tr>
			<tr>
				<td><asp:TextBox ID="tbUserId" runat="server" Width="98px"></asp:TextBox></td>
				<td><asp:TextBox ID="tbAchternaam" runat="server" Width="98px"></asp:TextBox></td>
				<td><asp:TextBox ID="tbWoonplaats" runat="server" Width="98px"></asp:TextBox></td>
				<td><asp:TextBox ID="tbEmail" runat="server" Width="98px"></asp:TextBox></td>
			</tr>
		</table>
		             <asp:RadioButtonList ID="RadioButtonList1" runat="server" 
            BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" >
                        <asp:ListItem Selected="True" Value="0">Geen filter</asp:ListItem>
                        <asp:ListItem Value="1">Saldo > 0</asp:ListItem>
                    </asp:RadioButtonList>

		<asp:Button ID="Button1" runat="server" Text="Zoek"/>
    </asp:Panel>
    
    <asp:Panel id="resultPanel" runat="server" Visible="false">
		<p class="title">Zoekresultaten</p>
	    <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
            AutoGenerateColumns="False" CellPadding="4" DataKeyNames="Id" 
            DataSourceID="dsUser" ForeColor="#333333">
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#EFF3FB" />
            <Columns>
                <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" 
                    ReadOnly="True" SortExpression="Id" />
                <asp:BoundField DataField="Voorletters" HeaderText="Voorl" 
                    SortExpression="Voorletters" />
                <asp:BoundField DataField="Tussenvoegsel" HeaderText="Tus.v." 
                    SortExpression="Tussenvoegsel" />
                <asp:BoundField DataField="Achternaam" HeaderText="Achternaam" 
                    SortExpression="Achternaam" />
                <asp:BoundField DataField="Woonplaats" HeaderText="Woonplaats" 
                    SortExpression="Woonplaats" />
                <asp:CheckBoxField DataField="Geslacht" HeaderText="M/F" 
                    SortExpression="Geslacht" />
                <asp:BoundField DataField="Email" 
                    DataFormatString="&lt;a href=&quot;mailto:{0}&quot;&gt;{0}&lt;/a&gt;" 
                    HeaderText="Email" HtmlEncode="False" SortExpression="Email" />
                <asp:BoundField DataField="Rekeningnummer" HeaderText="Rknr" 
                    SortExpression="Rekeningnummer" />
                <asp:BoundField DataField="Gebruikersnaam" HeaderText="UserId" 
                    SortExpression="Gebruikersnaam" />
                <asp:BoundField DataField="Aanmelddatum" 
                    DataFormatString="{0:yyyy-MM-dd, HH:mm:ss}" HeaderText="Aanmelddatum" 
                    SortExpression="Aanmelddatum" />
                 <asp:BoundField DataField="LastLogin" 
                    DataFormatString="{0:yyyy-MM-dd, HH:mm:ss}" HeaderText="Laatste login" 
                    SortExpression="LastLogin" />
                <asp:TemplateField HeaderText="Info">
                    <ItemTemplate>
                        <a class="common" href='AdminGetUserInfo.aspx?uid=<%# DataBinder.Eval(Container.DataItem, "Gebruikersnaam") %>'>Info</a>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Saldo muteren">
                    <ItemTemplate>
                        <a class="common" href='AdminChangeBalance.aspx?uid=<%# DataBinder.Eval(Container.DataItem, "Gebruikersnaam") %>'>Saldo muteren</a>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Saldo"
					HeaderText="Saldo"
					SortExpression="Saldo"
					DataFormatString="{0:c2}" />
            </Columns>
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#2461BF" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
        <asp:SqlDataSource ID="dsUser" runat="server"
            ConnectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|AandelenDelen.accdb"
            ProviderName="System.Data.OleDb"
            SelectCommand="SELECT [Id], [Voorletters], [Tussenvoegsel], [Achternaam], [Woonplaats], [Geslacht], [Email], [Rekeningnummer], [Gebruikersnaam], [Aanmelddatum] FROM [Naw] WHERE (([Gebruikersnaam] LIKE '%' + ? + '%') AND ([Achternaam] LIKE '%' + ? + '%') AND ([Woonplaats] LIKE '%' + ? + '%'))">
            <SelectParameters>
                <asp:Parameter DefaultValue="%" Name="Gebruikersnaam" Type="String" />
                <asp:Parameter DefaultValue="%" Name="Achternaam" Type="String" />
                <asp:Parameter DefaultValue="%" Name="Woonplaats" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    </asp:Panel>
   
		<br />
		<hr />
		<a class="common" href="AdminMainForm.aspx">Hoofdmenu</a>
    </div>    
    </form>
</body>
</html>
